package cn.reinforce.util.echarts;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Pie {

	private String title;
	
	private List<String> legend = new ArrayList<>();
	
	private List<Series> series = new ArrayList<>();
	

	public void newSeries(String name, int value, boolean filterZero){
		//过滤0数据
		if(filterZero&&value==0){
			return;
		}
		Series s = new Series();
		s.setName(name);
		s.setValue(value);
		series.add(s);
	}

	@Data
	class Series {

		private String name;
		
		private int value;
		
	}
	
	
}
